<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
<title> 客户修改 </title>

<?php include VIEWS.'admin/style.html'?>
<?php include VIEWS.'admin/script.html'?>

<script type="text/javascript">
<!--
var ajax = ajaxStart('post');
var timer = null;

function user_update() {
    $('submit').disabled = true;
    var f = $('updateform');
    ajax.call('usersedit.php?id=<?php echo $data["id"]?>', 'ajaxadminEdit', userupdate_result, $('updateform').serialize());
}

function userupdate_result(result) {
    var i;
    var d = $('updatemsg');
    try {
        i = (result.result[0].data == 1 ? '更新成功' : '<font color=FFFF66>更新失败</font>，请检查您填写的资料完整性后再提交');
    } catch(e) {
        i = '服务器错误，请稍候再试';
        d.style.backgroundColor= '#FF99FF';
    }

    $('submit').disabled = false;
    d.innerHTML = '&nbsp;&nbsp;&nbsp;' + i + '……';
    d.style.display = 'block';
    new Effect.Round('div', 'updatemsg');
    location.href="#top";
    if (timer) window.clearTimeout(timer);
    timer = setTimeout( "$('updatemsg').style.display='none';", 10000);
}
//-->
</script>

</head>

<body>
<a name="top" />

<?php include VIEWS.'admin/head.html'?>

<ul id="submenu">
	<li><a href='users.php' class="current">客户列表</a></li>
</ul>


<div id="body">

<div class="updatemsg" id="updatemsg" style="font-weight:bold;background-color:#FFCC66;font-size:12px;width:80%;display:none;">&nbsp;</div>
<br clear="all" />

<div align="left">
<form action="" method="post" id="updateform" onsubmit="javascript:user_update();return false;">
<table class="reportV2" cellpadding="5" width="80%" cellspacing="0" border="1">
<tr class="columntitle"><td style="text-align:left" colspan="2">客户资料更新</td></tr>
<tr><td nowrap width="20%">ID</td><td style="text-align:left"><?php echo $data['id']?></td></tr>
<tr><td nowrap>用户名</td><td style="text-align:left"><?php echo $data['username']?></td></tr>
<tr><td nowrap>昵称</td><td style="text-align:left"><?php echo $data['nickname']?></td></tr>
<tr><td nowrap>密码</td><td style="text-align:left"><input type="password" name="password" value="<?php echo $data['password']?>"></td></tr>
<tr><td nowrap>Email</td><td style="text-align:left"><input type="text" name="email" value="<?php echo $data['email']?>"></td></tr>
<tr><td nowrap>真实姓名</td><td style="text-align:left"><input type="text" name="truename" value="<?php echo $data['truename']?>"></td></tr>
<tr><td nowrap>级别</td><td style="text-align:left"><input type="text" name="rank" value="<?php echo $data['rank']?>"></td></tr>
<tr><td nowrap>积分</td><td style="text-align:left"><input type="text" name="score" value="<?php echo $data['score']?>"></td></tr>
<tr><td nowrap>加入时间</td><td style="text-align:left"><?php echo date('M/d/Y H:i',$data['created'])?></td></tr>
<tr><td nowrap><b>推荐人</b></td><td style="text-align:left"><a href="usersedit.php?id=<?php echo $data['camefrom']?>"><b><?php echo $data['camefrom']?></b></a></td></tr>
<tr class="columntitle"><td style="text-align:left" colspan="2">附加资料</td></tr>
<?php do_action('view_admin_usercustomfields', array('data'=>&$data));?>
<tr><td colspan="2" style="text-align:left" class="submit"><input id="submit" type="submit" value="更新用户信息" style="font-weight:bold">&nbsp;<input type="reset" value="重置" style="font-weight:bold"></td></tr>
</table>
</form>
</div>

<?php include VIEWS.'admin/runtime.html'?>
</div>

</body>
</html>
